import { request } from "@/utils/http";
import { ReaHospitalList, ReqHospitalShow, ReqHospitallistListAll, ReqprovinceList, UpdateHospitalxian, getdepartmentValue, getdepartmentValueList } from "./model/hospitalListType";


// 定义初始化医院函数
export function getHospitalValue({ page, limit, ...argu }: ReaHospitalList) {

    return request.get<any, ReqHospitallistListAll>(`/admin/hosp/hospital/${page}/${limit}`,{
        params:argu
    })
}
// 获取省份
export function getprovinceValue(){
    return request.get<any,ReqprovinceList>("/admin/cmn/dict/findByDictCode/province")
}
// 获取市
export function getCityprovinceValue(id:number){
    return request.get<any,ReqprovinceList>(`/admin/cmn/dict/findByParentId/${id}`)
}
// 获取区
export function getClassifyprovinceValue(id:number){
    return request.get<any,ReqprovinceList>(`/admin/cmn/dict/findByParentId/${id}`)
}
// 获取医院数据
export function getHospitalTypeValue(id:number){
    return request.get<any,ReqprovinceList>(`/admin/cmn/dict/findByParentId/${id}`)
}
// 修改医院上下线状态
export function UpdateHospitalType({id,status}:UpdateHospitalxian){
    return request.get<any,null>(`/admin/hosp/hospital/updateStatus/${id}/${status}`)
}
// 医院详情展示
export function HospitalListShow(id:string){
    return request.get<any,ReqHospitalShow>(`/admin/hosp/hospital/show/${id}`)
}
// 获取科室分页列表数据
export function ReqParameters(hoscode:string){
    return request.get<any,getdepartmentValueList>(`/admin/hosp/department/${hoscode}`)

}
